﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using LiJu.Model;

namespace LiJu.Db
{
    public class ComportHelper
    {
        /// <summary>
        ///通过类型查询通信端口
        /// 类型:0力臂 1电批 2套筒 3上料机
        /// </summary>
        /// <returns></returns>
        public static ComportModel GetComportbyType(int type)
        {
            //获取没有删除的产品
            string strMySql = $"select * from comport where PortType={type} ";
            DataTable dt = DalMySQL.ExecuteDataTable(strMySql);
            var listTask = DbExtension.DataTableToList<ComportModel>(dt);
            if (listTask.Count > 0)
            {
                return listTask[0];
            }
            else
            {
                return null;
            }
        }
    }
}
